# $Id$
# Maintainer: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>

pkgname=libzip
pkgver=1.5.1
pkgrel=1
pkgdesc="A C library for reading, creating, and modifying zip archives"
url="https://libzip.org"
license=('BSD')
arch=('x86_64')
depends=('zlib' 'bzip2' 'openssl')
makedepends=('cmake')
source=("${url}/download/${pkgname}-${pkgver}.tar.xz")
sha256sums=('04ea35b6956c7b3453f1ed3f3fe40e3ddae1f43931089124579e8384e79ed372')

build() {
  cd "${pkgname}-${pkgver}"

  mkdir build && cd build
  cmake -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    ..
  make
}

package() {
  cd "${pkgname}-${pkgver}"/build

  make DESTDIR="${pkgdir}" install
  install -Dm644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
